from django.core.management.base import BaseCommand
from celery import Celery

class Command(BaseCommand):
    help = 'Start Celery worker'

    def handle(self, *args, **options):
        self.stdout.write("Starting Celery worker...")
        celery = Celery('Al_Compny_backend')
        celery.config_from_object('django.conf:settings', namespace='CELERY')
        celery.worker_main(['worker', '--loglevel=info', '--logfile=celery.log', '--pool=solo'])